package com.atuguigu.boot3.core.controller;

import com.atuguigu.boot3.core.entity.User;
import com.atuguigu.boot3.core.event.EventPublisher;
import com.atuguigu.boot3.core.service.AccountService;
import com.atuguigu.boot3.core.service.CouponService;
import com.atuguigu.boot3.core.service.SysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    AccountService accountService;
    @Autowired
    CouponService couponService;
    @Autowired
    SysService sysService;

    @Autowired
    EventPublisher eventPublisher;
    @GetMapping("/login")
    public User login(String username,String pwd){

        //LoginSuccessEvent loginSuccessEvent =new LoginSuccessEvent(new User(username,pwd));
        //eventPublisher.sendEvent(loginSuccessEvent);

        /*accountService.addAccountScore(username);
        couponService.sendCoupon(username);
        sysService.recordLog(username);*/

//        return new User(username,pwd);
        return null;
    }
}
